/**
 * Project Name:dyrj-core
 * File Name:ResultMsg.java
 * Package Name:com.dyrj.vo
 * Date:2017年10月17日下午4:18:11
 * Copyright (c) 2017, zhang.xiangyu@foxmail.com All Rights Reserved.
*/
package com.dyrj.vo;

import java.io.Serializable;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @Title: ResultMsg.java
 * @Package com.dyrj.vo
 * @Description: TODO(返回消息)
 * @author
 * @date 2017年10月17日 下午4:18:11
 * @version V1.0
 */
@ApiModel(value = "ResultMsg", description = "消息返回")
@ApiIgnore
@Data
public class ResultMsg<T> implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 状态码
	 */
	@ApiModelProperty("状态码")
	private int code;

	/**
	 * 消息内容
	 */
	@ApiModelProperty("消息内容")
	private String message;

	/**
	 * 权限令
	 */
	@ApiModelProperty("权限令牌")
	@JSONField(name = "access_token")
	private String accessToken;

	private String introduction;

	private String avatar;

	private String name;
	private Long deptid;

	public Long getDeptid() {
		return deptid;
	}

	public void setDeptid(Long deptid) {
		this.deptid = deptid;
	}

	public Long getUserid() {
		return userid;
	}

	public void setUserid(Long userid) {
		this.userid = userid;
	}

	private Long userid;

	private String[] roles;


	/**
	 * 返回数据
	 */
	@ApiModelProperty("返回数据")
	private T data;

	public ResultMsg(int code, String message) {
		this.code = code;
		this.message = message;
	}

	public ResultMsg(int code, String message, String accessToken) {
		this.code = code;
		this.message = message;
		this.accessToken = accessToken;
	}

	public ResultMsg(int code, String message, String accessToken, T data) {
		this.code = code;
		this.message = message;
		this.accessToken = accessToken;
		this.data = data;
	}

	public ResultMsg(int code, T data) {
		this.code = code;
		this.data = data;
	}

	public ResultMsg(int code, String message, T data) {
		this.code = code;
		this.message = message;
		this.data = data;
	}

	public String getIntroduction() {
		return introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String[] getRoles() {
		return roles;
	}

	public void setRoles(String[] roles) {
		this.roles = roles;
	}
}
